package com.hackerrank.challenges.ncrtable;

import java.math.BigInteger;
import java.util.Scanner;

public class Solution {
	private static final BigInteger MAX = new BigInteger("1000000000");
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int T = in.nextInt();
		for(int t = 0; t < T; t++) {
			int n = in.nextInt();
			BigInteger ncr[] = new BigInteger[n + 1];
			ncr[0] = BigInteger.ONE;
			for(int r = 1; r <= n / 2; r++)
				ncr[r] = ncr[r - 1].multiply(new BigInteger(Integer.toString(n - r + 1))).divide(new BigInteger(Integer.toString(r)));
			for(int r = n / 2 + 1; r <= n; r++)
				ncr[r] = ncr[n - r];
			for(int r = 0; r <= n; r++)
				System.out.print((ncr[r].remainder(MAX)) + " ");
			System.out.println();
		}
	}
}
